﻿


/*========================================================================================
//香港绿瘦国际集团 -- WebAnalytics
//创建者: 余波
//创建时间：2012年3月29日
//类描述：实体类 TUserRightsIp (属性说明自动提取数据库字段的描述信息)
//最后修改者:余波
//最后修改时间:2012年3月29日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.Rights.Model
{
    /// <summary>
    /// 实体类 TUserRightsIp (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "TUserRightsIp", PrimaryKey = "GID", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class TUserRightsIpInfo : BaseModel
    {
        public TUserRightsIpInfo()
        {            
            PrimaryKey = "GID"; 
			Fields.Add("ID");//标识
			Fields.Add("GID");//主键
			Fields.Add("UID");//用户帐号
			Fields.Add("IPs");//授权IP
			Fields.Add("LastEditBy");//最后修改人
			Fields.Add("LastEditDate");//最后修改时间
			
			
			
			CanNotNullFields.Add("GID");//主键不能为空!				
			this.OnCreated();			
			this.OnModelCreated();
        }
		public TUserRightsIpInfo(bool isNewInfo):this()
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
			
            GID = Guid.NewGuid().ToString();
        }
        #endregion 
		
		#region 成员变量
				
		private int? _ID;//标识
		private string _GID;//主键
		private string _UID;//用户帐号
		private string _IPs;//授权IP
		private string _LastEditBy;//最后修改人
		private DateTime? _LastEditDate;//最后修改时间
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// 标识
        /// </summary>       
		[ModelField(Description = "标识", Type = typeof(int?), ErrorMessage = "标识信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 4,  DbType = "int", IsNeedRecordModify = true)]
        public virtual int? ID
        {
            get
            {
                return this._ID;
            }
            set
            {
				_ID = value;
            }
        }
		
		/// <summary>
        /// 主键
        /// </summary>       
		[ModelField(Description = "主键", Type = typeof(string), ErrorMessage = "主键信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 36,  DbType = "char", IsNeedRecordModify = true)]
        public virtual string GID
        {
            get
            {
                return this._GID;
            }
            set
            {
                if (_GID != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TUserRightsIp", "GID", _GID, value, "char", "主键");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnGIDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._GID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnGIDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _GID = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 用户帐号
        /// </summary>       
		[ModelField(Description = "用户帐号", Type = typeof(string), ErrorMessage = "用户帐号信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 100,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string UID
        {
            get
            {
                return this._UID;
            }
            set
            {
                if (_UID != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TUserRightsIp", "UID", _UID, value, "nvarchar", "用户帐号");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnUIDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._UID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnUIDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _UID = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 授权IP
        /// </summary>       
		[ModelField(Description = "授权IP", Type = typeof(string), ErrorMessage = "授权IP信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 1000,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string IPs
        {
            get
            {
                return this._IPs;
            }
            set
            {
                if (_IPs != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TUserRightsIp", "IPs", _IPs, value, "nvarchar", "授权IP");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnIPsChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._IPs = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnIPsChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _IPs = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 最后修改人
        /// </summary>       
		[ModelField(Description = "最后修改人", Type = typeof(string), ErrorMessage = "最后修改人信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string LastEditBy
        {
            get
            {
                return this._LastEditBy;
            }
            set
            {
                if (_LastEditBy != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TUserRightsIp", "LastEditBy", _LastEditBy, value, "nvarchar", "最后修改人");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLastEditByChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._LastEditBy = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLastEditByChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _LastEditBy = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 最后修改时间
        /// </summary>       
		[ModelField(Description = "最后修改时间", Type = typeof(DateTime?), ErrorMessage = "最后修改时间信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 8,  DbType = "datetime", IsNeedRecordModify = true)]
        public virtual DateTime? LastEditDate
        {
            get
            {
                return this._LastEditDate;
            }
            set
            {
                if (_LastEditDate != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TUserRightsIp", "LastEditDate", _LastEditDate, value, "datetime", "最后修改时间");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLastEditDateChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._LastEditDate = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLastEditDateChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _LastEditDate = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnIDChanging(ModifyInfo modifyInfo);//标识ID改变之前发生
        partial void OnIDChanged(ModifyInfo modifyInfo);//标识ID改变之后发生
		partial void OnGIDChanging(ModifyInfo modifyInfo);//主键GID改变之前发生
        partial void OnGIDChanged(ModifyInfo modifyInfo);//主键GID改变之后发生
		partial void OnUIDChanging(ModifyInfo modifyInfo);//用户帐号UID改变之前发生
        partial void OnUIDChanged(ModifyInfo modifyInfo);//用户帐号UID改变之后发生
		partial void OnIPsChanging(ModifyInfo modifyInfo);//授权IPIPs改变之前发生
        partial void OnIPsChanged(ModifyInfo modifyInfo);//授权IPIPs改变之后发生
		partial void OnLastEditByChanging(ModifyInfo modifyInfo);//最后修改人LastEditBy改变之前发生
        partial void OnLastEditByChanged(ModifyInfo modifyInfo);//最后修改人LastEditBy改变之后发生
		partial void OnLastEditDateChanging(ModifyInfo modifyInfo);//最后修改时间LastEditDate改变之前发生
        partial void OnLastEditDateChanged(ModifyInfo modifyInfo);//最后修改时间LastEditDate改变之后发生
		
		#endregion		
		public override void OnLoaded()
        {
            base.OnLoaded();	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}